package org.web.accesscontrollist.server.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;


@Setter
@Getter
@Configuration
@Validated
@PropertySource(
    value = {"classpath:application.properties", "classpath:database.properties"},
    name = "ss",
    encoding = "utf-8",
    ignoreResourceNotFound = true)
@ConfigurationProperties(
prefix = "org.web.access-control-list.access-control-list-server",
ignoreInvalidFields = true)
public class AccessControlListServerConfig {

    @NotBlank()
    @Value(value = "${org.web.access-control-list.access-control-list-server.strValue:str}")
    private String strValue;


    @Min(value = 10)
    @Value(value = "${org.web.access-control-list.access-control-list-server.intValue:11}")
    private int integerValue;

}
